<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 16690
  Date: 2020/9/16
  Time: 22:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>隔行换色</title>
    <style type="text/css">
        div{
            height: 50px;
            margin: 0px;
            padding: 0px;
        }
    </style>
</head>
<body>

<c:forEach begin="0" end="10" step="1" var="color" varStatus="vs">
    <div
    <c:if test="${color%2==0}" var="val">style="background-color: red" </c:if> >
    </div>
</c:forEach>
</body>
</html>
